<template>
	<view class='container bg-w'>
		<view class="header uni-flex uni-row flex-between">
			<uni-nav-bar title="考勤管理">
				<template slot='left'>
					<view class="flex width-100">
						<i class='iconfont iconfanhui' @click='goBack()'></i>
					</view>
				</template>
				<template slot='right'>
					<view class="flex width-30">
						<text class="replace_btn" @click='replacePop'>请假补卡</text>
					</view>
				</template>
			</uni-nav-bar>
		</view>
		<view class="container_main">
			<view class="buildList" v-if="peopelLists.length > 0">
				<uni-list>
				    <uni-list-item v-for="(item,index) in peopelLists" :key="index" showArrow link 
						:to="'/pages/Application/CheckWorkManage/manageInfo/peopleCheckInfo?userId=' + item.userId
							+'&username=' + item.username 
							+'&phone=' + item.phone">
						<template slot='body'>
							<view class="buildList-body">
								<view class="color-6 flex algin-i-c">
									<text class="txtCut1">{{item.username}}</text>
								</view>
							</view>
						</template>
					</uni-list-item>
				</uni-list>
			</view>
		</view>
	</view>
</template>

<script>
import { getAllSubPeople } from "@/common/api/attenApi.js"
	export default {
		data() {
			return {
				peopelLists: []
			}
		},
		mounted(){
			this.getAllSubPeoples()
		},
		methods: {
			/**
			 * 获取考勤记录人员列表
			 * @method getAllSubPeoples
			 */
			getAllSubPeoples:function() {
				let _this = this
				getAllSubPeople().then(res=>{
					_this.peopelLists = res.data
				})
			},
			replacePop:function() {
				uni.navigateTo({
				    url: '/pages/Application/CheckWorkManage/manageInfo/leaveReplaceManage' //?id=1&name=uniapp
				});
			}
		}
	}
</script>

<style lang="less">
.container_main{
	position: relative;
	top: 70px;
	overflow-y: scroll;
	background-color: #eee;
}
.replace_btn{
	color: #09AAE9;
}
</style>
